<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/diyUpload.css">
    <link rel="stylesheet" href="css/webuploader.css">
    <title>系统设置</title>
    <script src="js/jquery-1.10.1.min.js"></script>
    <script src="js/config.js"></script>
    <script src="js/message.js"></script>
</head>
<body>
<div class="nei_header">
    <h3>系统设置</h3>
    <div class="rentu">
        <img src="images/renturn.png" alt="" onclick="window.history.back(-1)">
    </div>
    <i class="moix" onclick="location.href='tab.html'">菜单</i>
</div>


<div class="danju_con">

    <div class="danju_left shezhi_left">
        <div class="dan_title" style="text-align: center; font-size: 18px;">
            系统设置
        </div>

        <div class="danju_lis shezhi">
            <ul>
                <li onclick="location.href='xitongshezhi.html'"> 通用设置</li>
                <li class="on"> 订单设置</li>
                <li onclick="location.href='zhanghaoshezhi.html'"> 账号管理</li>
            </ul>
        </div>
    </div>


    <!--&lt;!&ndash;订单设置开始&ndash;&gt;-->

    <div class="shezhi_con">
        <div class="lst">
            <table style="position: absolute; left: 21%; top: 80px; width: 78%; height: 40px; overflow-y: auto;">
                <tr>
                    <td width="25%">
                        类型：
                        <select id="type" style="width:167px;height: 25px;border: 1px solid #00b8c9;">
                            <option value="">请选择</option>
                            <option value="1">支付宝</option>
                            <option value="2">微信</option>
                        </select>
                    </td>
                    <td width="25%">
                        面值：<input style="height: 25px;border: 1px solid #00b8c9;" id="amount" type="text"
                                  placeholder="面值"/>
                    </td>
                    <td width="25%">
                        账号：<input style="height: 25px;border: 1px solid #00b8c9;" id="acct" type="text"
                                  placeholder="账号"/>
                    </td>
                    <td align="right">
                        <div class="duihcu">
                            <button style="background-color: #27ae60;" onclick="location.href='shangchuan.html'">上传
                            </button>
                        </div>
                    </td>
                    <td align="right">
                        <div class="duihcu">
                            <button style="background-color: #ff5555;" onclick="query()">查询</button>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <section style="position: absolute; left: 21%; top: 160px; width: 78%; height: 610px; overflow-y: auto;">
            <div class="main_box">
                <div class="cont_box editpro_box">
                    <!--财务报表-->
                    <table border="0" cellspacing="0" cellpadding="0" class="table" id="table_box">
                        <thead>
                        <tr>
                            <th>类型</th>
                            <th>所属账号</th>
                            <th>面值</th>
                            <th>图片</th>
                        </tr>

                        </thead>
                        <tbody id="payBody">

                        </tbody>
                    </table>
                </div>

            </div>
        </section>
        <!--底部-->

        <div class="mifooter">
            <div class="page">
                <span onclick="initTable(false)">上页</span>
                <span id="pageText">1/1</span>
                <span onclick="initTable(true)">下页</span>
            </div>
        </div>

        <!--底部-->
    </div>

</div>


</body>
<script type="application/javascript">
    var page = 0;
    var total = 0;

    function query() {
        page = 0;
        total = 0;
        initTable(true);
    }

    function initTable(b) {
        if (b) {
            if (total == 0 && page > 0) {
                $.message({
                    message: "无数据",    //提示信息
                    duration: 3000,
                    type: 'info',           //显示类型，包括4种：success.error,info,warning 默认info
                    showClose: false       //显示关闭按钮（默认：否）
                });
                return;
            } else if (total != 0 && total == page) {
                $.message({
                    message: "已是末页",    //提示信息
                    duration: 3000,
                    type: 'warning',           //显示类型，包括4种：success.error,info,warning 默认info
                    showClose: false       //显示关闭按钮（默认：否）
                });
                return;
            }
            page++;
        } else {
            if (page == 1) {
                $.message({
                    message: "已是首页",    //提示信息
                    duration: 3000,
                    type: 'warning',           //显示类型，包括4种：success.error,info,warning 默认info
                    showClose: false       //显示关闭按钮（默认：否）
                });
                return;
            }
            page--;
        }
        let type = $("#type").val();
        let amount = $("#amount").val();
        let acct = $("#acct").val();
        cashierPost("paytype/list.do", {
            type: type,
            amount: amount,
            acct: acct,
            pageNo: page,
            pageSize: 10
        }, someFunction);
    }

    function someFunction(result) {
        let tableHtml = "";
        if (result.list == null || result.list.length <= 0) {
            $.message({
                message: "无数据",    //提示信息
                duration: 3000,
                type: 'success',           //显示类型，包括4种：success.error,info,warning 默认info
                showClose: false       //显示关闭按钮（默认：否）
            });
        } else {
            for (let m of result.list) {
                tableHtml +=
                    "<tr>" +
                    "<td>" + (m.type == 1 ? '支付宝' : '微信') + "</td>" +
                    "<td>" + m.acct + "</td>" +
                    "<td>" + m.amount + "</td>" +
                    "<td><a style='border-bottom: 1px solid #095fb5;color: #095fb5;' href='" + baseUrl + "payfile/" + m.image + "'>" + m.image + "</a></td>" +
                    "</tr>";
            }
        }
        $("#payBody").html(tableHtml);
        total = result.pages;
        $("#pageText").text(page + "/" + total);
    }

</script>
</html>